//
//  PubLic.m
//  shike
//
//  Created by RegentSoft on 2017/4/19.
//  Copyright © 2017年 RegentSoft. All rights reserved.
//

#import "PubLic.h"

@implementation PubLic
+(NSString*)logingetToken{
    NSString * tokenString = @"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRkOThjM2JhMDdjYzIwZDJlMjM1NDAxOTY1NDg2MzllMTJkM2EzMjcxNjdmMjEzMDk2ZDM5ZGJjM2Q5ZWY1Y2UzNjMwYjhlZDI3MmE0ZDg2In0.eyJhdWQiOiIyIiwianRpIjoiNGQ5OGMzYmEwN2NjMjBkMmUyMzU0MDE5NjU0ODYzOWUxMmQzYTMyNzE2N2YyMTMwOTZkMzlkYmMzZDllZjVjZTM2MzBiOGVkMjcyYTRkODYiLCJpYXQiOjE0OTI1NzI2MzUsIm5iZiI6MTQ5MjU3MjYzNSwiZXhwIjoxNDkzODY4NjM1LCJzdWIiOiI4NmQzMGFiYzI0YWUxMWU3YjI1MjAwMTYzZTAyYzA3MiIsInNjb3BlcyI6W119.dqs_57XRkeU_l1Qe4NdHp462dPK6XU22EEAzcaxwg4sOd4csb-noOQRQ0Dwgpo_yjv0jR6B-iAGGibQ_BRcrWkmNZqt28oLXGw5yWZuTNvNLPB-Fiwf0xkLAsXPoZqz8ZDCjs5fM_f0xRWroUTXaskc2FqEChvSSY0lNzEAE1vh5R0SZycdT_N-RKkBETVO50Y_IRIgU88sJruxvlg8N9LFIbXn7IaEuff-BZqEM9IMBgyoic4fIjJN5WQCi7-eLf-SbYT2FvJZ3HF-4Ys6ozbGA-fQq823-tioVi7GxG2gi2VXRJcbsJ-yYq5C6a6TDFS14BvehXaRZ4uxLfFLMIuZmfWLQOvcPGNpSVoll7Gc6pIWHsw2o6x3JsFFOOOzKwtx8-FOqBeJ_xejEIjDrthTNv8ejkJcmi2v74gNxHKyGMVuvEkTLB-MsrdC4ChyvgMGCjeLpPkahiYqc41wxm-6cKZPSYvH-vLc7nPRMhLarwp-nPbF9NsKzMTmRIAIjt0AxnjYatOc7140J0qam9gp1i6M1BkuMzCKmjBaJxAcz9Mzkn0eIvobU7a5MAitk5GOqRwLYQ9w_V_hiTGO-9u1RoyrP1BvKYfwxf7RBfReDkk4Ug_VLYlTAACAAIWm7I21cSgqqXvCZbhukX8G18fGHL4x7bJ1FSm818oy7jow";
    return tokenString;
}

+(NSString*)getPlistParameter:(NSString*)keyString{
    
    return [[NSUserDefaults standardUserDefaults] objectForKey:keyString];
}
//设置常用参数保存到plist文件
+(void)setPlistParameter:(NSString*)valueString setKey:(NSString*)keyString{
    [[NSUserDefaults standardUserDefaults]setObject:valueString forKey:keyString];
    [[NSUserDefaults standardUserDefaults] synchronize];
}
//字符串转化数组||字典
+(id)toJsonObject:(NSString *)string error:(NSError **)error
{
    if (string == nil) return nil;
    NSData *jsonData = [string dataUsingEncoding:NSUTF8StringEncoding];
    return [NSJSONSerialization JSONObjectWithData:jsonData
                                           options:NSJSONReadingAllowFragments
                                             error:error];
}
//数组||字典转化为字符串
+(NSString *)toJsonString:(id)object error:(NSError **)error
{
    
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
                                                       options:NSJSONWritingPrettyPrinted
                                                         error:error];
    return [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
}
@end
